package com.lancoo.ccas52.mapper;
import java.util.Collection;

import com.lancoo.ccas52.entity.RuleUsable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lancoo.ccas52.config.MybatisRedisCache;
import com.lancoo.ccas52.pojo.dto.BasicRule;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 基础规则 Mapper 接口
 * </p>
 *
 * @author quin.song
 * @since 2023-03-23
 */
@CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class)
public interface RuleUsableMapper extends BaseMapper<RuleUsable> {

    int addBatch(@Param("ruleUsableCollection") Collection<RuleUsable> ruleUsableCollection);

    void setBasicRule(@Param("rules") List<BasicRule> rules, @Param("taskId") Integer taskId);

    List<RuleUsable> getByTaskId(@Param("taskId") Integer taskId);

    /**
     * 根据学校id和学期获取课时方案
     * @param schoolId
     * @param term
     * @return
     */
    List<RuleUsable> getBySchoolTerm(@Param("schoolId") String schoolId,@Param("term") String term,@Param("collegeId") String collegeId);

}
